<?php
    
    namespace App\Module\Api\Validator;
    use App\System\Base\Validator\BaseValidator;

    /**
     * 定义验证器类
     * @author liujun
     */
    class AddressSubmitValidator extends BaseValidator
    {
        protected $rules = [
            'q.address' => 'required',
            'q.address.id' => 'filled|integer',
            'q.address.name' => 'required',
            'q.address.mobile' => 'required|regex:/^1[0-9]{10}$/',
            'q.address.isDefault' => 'required|integer:between:1,2',
            'q.address.regionId' => 'required|integer',
            'q.address.street' => 'required'
        ];
        
        protected $messages = [

        ];

        protected $attributes = [
            'q.address' => '地址',
            'q.address.id' => '地址id',
            'q.address.name' => '收货人',
            'q.address.mobile' => '手机号',
            'q.address.isDefault' => '默认参数',
            'q.address.regionId' => '地区ID',
            'q.address.street' => '详细地址'
        ];
    }